Skip to content

test: address test failures by increasing maxBuffer limit#13265

Merged
kgryte merged 1 commit into
developfrom
claude/elegant-feynman-8i8r1f
Jul 4, 2026
Merged

test: address test failures by increasing maxBuffer limit#13265
kgryte merged 1 commit into
developfrom
claude/elegant-feynman-8i8r1f

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • Fixes stdout maxBuffer length exceeded failures in lib/node_modules/@stdlib/namespace/test/test.cli.js, which fail every run_affected_tests / run_tests_coverage run that touches the namespace package.

Failing run: https://github.com/stdlib-js/stdlib/actions/runs/28686663068

Symptom:

Running test: lib/node_modules/@stdlib/namespace/test/test.cli.js
stdout maxBuffer length exceeded
	at:       'done (.../namespace/test/test.cli.js:238:6)'
make: *** [.../tools/make/lib/test/javascript.mk:318: test-javascript-files-min] Error 1

Root cause: Two tests in test.cli.js exec() the namespace CLI and capture its full stdout — one as CSV (--fields alias,path), one as newline-delimited JSON (all fields, including related arrays) — using child_process.exec with no explicit maxBuffer, so Node's 1 MiB default applies. The stdlib namespace has grown to 3212+ entries, and the full JSON dump now exceeds that default, so exec() passes an error to its callback instead of stdout, which fails the test via t.fail(error.message). This is deterministic and will fail on every run going forward, not intermittent.

Fix: Add an explicit maxBuffer option (5000*1024, ~4.9 MiB) to both exec() calls that dump the full namespace. This matches the pre-existing {'maxBuffer': N*1024} convention already used across lib/node_modules/@stdlib/datasets/*/test/test.cli.js (e.g. moby-dick, cmudict, sotu) for CLI tests with large stdout. The other four exec() calls in the same file (--help, -h, --version, -V) produce trivial stderr-only output and were left unchanged. No source or CLI behavior changes — test-only.

Related Issues

Does this pull request have any related issues?

None.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request?

Validation: Three independent automated reviews (correctness, regression scope, style/conventions) all returned approve with no blocking findings.

  • Correctness: confirmed both namespace-dumping exec() calls are patched, confirmed the other four are trivial and don't need it, and estimated ~5x headroom over current output size (namespace would need to nearly quintuple before recurring).
  • Regression scope: confirmed the diff is test-only and minimal (12 insertions / 2 deletions, one file), confirmed raising maxBuffer does not mask a correctness bug (both tests still assert stdout content against a locally computed expected value), confirmed no source/CLI/CI files were touched.
  • Style: confirmed variable declaration order, quoting, spacing, and the N*1024 numeric-literal style all match the established sibling convention in datasets/*/test.cli.js, and that the local opts shadowing of the outer tape skip options mirrors the same pattern already used in those files.

Reviewer notes: All three reviewers independently flagged the same non-blocking style nit: the new local var opts (holding {maxBuffer}) shadows the outer, module-scope var opts (holding tape's {skip} option) within each test callback. This is intentional, harmless (the outer opts is already resolved as tape's second argument before the callback body runs), and is the identical pattern already used in lib/node_modules/@stdlib/datasets/moby-dick/test/test.cli.js and .../cmudict/test/test.cli.js, so no change was made.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Research and understanding

Disclosure

This PR was prepared by an automated CI-failure investigation routine (Claude Code). The root cause was identified by reading the failing job logs and namespace source, the fix was implemented to match an existing repo-wide convention, and it was validated by three independent automated reviews (correctness, regression scope, style) before opening this PR.


@stdlib-js/reviewers


Generated by Claude Code

The job "Run affected tests" in workflow `run_affected_tests` failed on
develop with `stdout maxBuffer length exceeded` while running
`lib/node_modules/@stdlib/namespace/test/test.cli.js:238`.

Root cause: two tests exec the namespace CLI and capture its full
stdout (a CSV dump and a newline-delimited JSON dump of all 3212+
namespace entries) via `child_process.exec` without an explicit
`maxBuffer`, so Node's 1 MiB default applies. The namespace has grown
past that limit, so `exec` now returns an error instead of stdout,
which fails the test via `t.fail(error.message)`. The failure is
deterministic and reproduces on every run, as the namespace only
grows.

This commit adds an explicit `maxBuffer` option (`5000*1024`) to both
`exec` calls, matching the existing `{'maxBuffer': N*1024}` convention
used in `lib/node_modules/@stdlib/datasets/*/test/test.cli.js` for
CLIs with large stdout. No source or CLI behavior changes.

Ref: https://github.com/stdlib-js/stdlib/actions/runs/28686663068
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
namespace $\\color{red}40273/40376$
$\\color{green}+99.74\\%$
$\\color{green}113/113$
$\\color{green}+100.00\\%$
$\\color{red}2/11$
$\\color{green}+18.18\\%$
$\\color{red}40273/40376$
$\\color{green}+99.74\\%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte marked this pull request as ready for review July 4, 2026 21:22
@kgryte kgryte requested a review from a team July 4, 2026 21:22
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. labels Jul 4, 2026
@kgryte kgryte changed the title test(@stdlib/namespace): raise exec maxBuffer in test.cli.js test: address test failures by increasing maxBuffer limit Jul 4, 2026
@kgryte kgryte merged commit b78fcb8 into develop Jul 4, 2026
52 checks passed
@kgryte kgryte deleted the claude/elegant-feynman-8i8r1f branch July 4, 2026 21:23
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Jul 4, 2026
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jul 4, 2026
@kgryte kgryte added the Tests Pull requests specifically adding tests. label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tests Pull requests specifically adding tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants